<table border="1"> 
      <tr>
          <td><b>Book Title</b></td>
          <td><b>Author(s)</b></td>
      </tr>
      <tr>
        <?php
        foreach ($data['books'] as $key_books=>$books) {
            $book_id = $key_books
        ?>    
           <td><?=$books?></td>
           <td>
        <?php        
        }
        foreach ($data['author_name_and_id'] as $k=>$author_name_and_id) {
        ?>    
              <a href="index.php?author_id=<?=$k?>"><?=$author_name_and_id?></a>&nbsp;&nbsp;&nbsp;
      <?php  }?>       
           </td>
      </tr>
 </table
 <br><br> 
 <form method="POST" action="book.php?book_id=<?=$data['book_id']?>">
                <label for="comment">Comment:</label>
                <textarea name="comment"></textarea>
                <input type="submit" value="OK">  
</form>
 <?php 
 if (!empty($data['errors_comment'])) {
     foreach ($data['errors_comment'] as $errors) {
         echo $errors;
     }
 }
 ?>
       <?php if ($data ['is_comment']){ ?>       
 <table border="1">
            <tr>
                <td><b>Comment:</b></td>
                <td><b>Published by:</b></td>
                <td><b>Date:</b></td>
            </tr>
 <br>           
<?php foreach ($data['comments'] as $key => $comment) 
      { 
?>   
            <tr>
                <td><?= $comment['content']?></td>
                <td><?= $comment['author']?></td>  
                <td><?= $comment['date']?></td>      
            </tr>         
<?php }   ?>         
  </table><br><br>          
       <?php } else { ?>
            <br><div>  <?=$data['errors']['nocomment'] ?> </div><br>
         <?php } ?>

